Tiny Hexer Script: Directives

Directives are used to control the compilation of Tiny Hexer Scripts.


top bottom

Directives tell Tiny Hexer how to compile Tiny Hexer Scripts. Only the compilation of commands following a directive is affected by that directive. Directives are written in the form

OPTION <name of the directive> <value>

Currently the following directives are supported:


top bottom
OPTION GLOBALVARS, <0 or 1>

If GLOBALVARS is set to 1, only one set of variables exist, so non-local subroutines (called by the CALL and LOOP commands and the CALL() function) can change variables globally.

When set to 0 (default), subroutines get their own copy of all variables, so they can change them locally, but on termination of the subroutine (RETURN command), changes are lost and the variable contents are reset to the values before calling the subroutine.

Local subroutines are affected only if they do not redefine global variables (otherwise the variables become local to the subroutine and their values are not derived from the equal-named global variables).

See also variables.


top bottom
OPTION OPT1,"<text>"
OPTION OPT2, "<text>"
OPTION OPT3, "<text>"
OPTION OPT4, "<text>"
OPTION OPT5, "<text>"

These directives are used to control user defined settings. OPT3, OPT4 and OPT5 are not yet used. OPT2 and OPT1/OPT2 are used in import and export scripts, respectively. OPT5 is used to define an icon for scripts listed under the Tools/Scripts menu


top bottom
OPTION READTAGS, <0 or 1>

If READTAGS is set to 1, the FILEREAD command and function store the current file position and amount of data read.

See also variable tagging.


top bottom
OPTION TARGET, <IMPORT, EXPORT or STRUCTUREVIEWER>

Using the TARGET directive you can tell Tiny Hexer that a script is not an ordinary one, but should be used with the "File/Import" command, the "File/Export" command or the structure viewer. If such a script is opened using the "Tools/Execute script" command, a warning message is displayed telling the user that the script is not designed to be executed directly. Also the structure viewer and the import/export commands refuse to use scripts not designed for them.


top bottom
OPTION TITLE,"<text>"

Using the TITLE directive you can set the caption of the structure viewer, list entries in "Import" and "Export" dialogs and the "Tools/Scripts" menu commands.
See the topic about localizing scripts for localized TITLE directives.


top bottom
OPTION UNDO, <0 or 1>

If UNDO is set to 1 (default), the contents of the currently active editor are stored internally before the script is executed to allow for restoring the file's previous state after the script finishes. If you are sure the script will not change the current editor's data (or the file is rather large), you can set UNDO to 0 to avoid unnecessary memory consumption.


top bottom
mirkes.de's Tiny Hexer, Copyright ⌐ Markus Stephany. All rights reserved.